* Wealth index calculation. Trevor Croft, 02/04/2022. Niger MIS 2021. cd 'C:\Users\21180\OneDrive - ICF\Projects\Analysis\Wealth Index Construction\NIMIS2021\Wealth '. include file='wealth_assets.sps'. missing values QH115 (99.9). execute. set tvars=both. * Macro definitions to perform some recoding automatically. * Note: Do not use an asterisk in front of a macro name to try to comment it out - it will run any way because of the way the macros are expanded. * Delete the line instead or change the spelling of the macro in the comment. * Do not use the names of macros in comments - they will also be expanded too, and likely will fail. *{Create binary variables based on condition and give label }. define dichotomize( !positional !enclose('(',')') / !positional !tokens(1) / !positional !tokens(1) ) compute !2=0. if (!1) !2=1. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *(Separate shared toilets from non-shared toilets). define shared_fac( !positional !tokens(1) / !positional !tokens(1) / !positional !tokens(1) ). compute !2 = 0. do if (QH106=1). + if (!1=1) !2 = 1. + compute !1 = 0. end if. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *{Reset missing values to 'does not have', change 2 code to 0}. define no2zero( !positional !tokens(1) ) if (missing(!1) | !1<>1) !1=0. value labels !1 0 'No' 1 'Yes'. !enddefine. *{Construct Variables}. * Source d'eau potable. dichotomize (QH101=11) QH101_11 "Source d'eau potable: Robinet dans logement". dichotomize (QH101=12) QH101_12 "Source d'eau potable: Robinet dans cour/parcelle". dichotomize (QH101=13) QH101_13 "Source d'eau potable: Robinet chez un voisin". dichotomize (QH101=14) QH101_14 "Source d'eau potable: Robinet public/Borne fontaine". dichotomize (QH101=21) QH101_21 "Source d'eau potable: Puits à pompe ou Forage". dichotomize (QH101=31 | QH101=41) QH101_31 "Source d'eau potable: Source protégée/Puits protégé". dichotomize (QH101=32) QH101_32 "Source d'eau potable: Puits non protégé". *ichotomize (QH101=41) QH101_41 "Source d'eau potable: Source protégée". dichotomize (QH101=42) QH101_42 "Source d'eau potable: Source non protégée". dichotomize (QH101=51) QH101_51 "Source d'eau potable: Eau de pluie". *ichotomize (QH101=61) QH101_61 "Source d'eau potable: Camion citerne". dichotomize (QH101=61 | QH101=71) QH101_71 "Source d'eau potable: Camion citerne/Charette avec petite citerne/Tonneau". dichotomize (QH101=81) QH101_81 "Source d'eau potable: Eau de surface (rivière/barrage/lac/mare/fleuve/canal/canal d'irrigation)". dichotomize (QH101=91) QH101_91 "Source d'eau potable: Eau en bouteille". dichotomize (QH101=92) QH101_92 "Source d'eau potable: Eau en sachet". dichotomize (QH101=96) QH101_96 "Source d'eau potable: Autre". * Type de toilettes. dichotomize (QH105=11) QH105_11 "Type de toilettes: Chasse d'eau connectée à un système d'égout". dichotomize (QH105=12) QH105_12 "Type de toilettes: Chasse d'eau connectée à une fosse septique". dichotomize (QH105=13) QH105_13 "Type de toilettes: Chasse d'eau connectée à une fosse d'aisances". dichotomize (QH105=14) QH105_14 "Type de toilettes: Chasse d'eau connectée à quelque chose d'autre". *ichotomize (QH105=15) QH105_15 "Type de toilettes: Chasse d'eau connectée à ne sait pas où". dichotomize (QH105=21) QH105_21 "Type de toilettes: Fosse d'aisances améliorée auto-aérée". dichotomize (QH105=22) QH105_22 "Type de toilettes: Fosse d'aisances avec dalle". dichotomize (QH105=23) QH105_23 "Type de toilettes: Fosse d'aisances sans dalle trou ouvert". *ichotomize (QH105=31) QH105_31 "Type de toilettes: Toilettes à compostage". dichotomize (QH105=31 | QH105=41) QH105_41 "Type de toilettes: Toilettes à compostage/Seau/tinette". dichotomize (QH105=51) QH105_51 "Type de toilettes: Toilettes/latrines suspendues". dichotomize (QH105=61) QH105_61 "Type de toilettes: Pas de toilettes/nature". dichotomize (QH105=96) QH105_96 "Type de toilettes: Autre". shared_fac QH105_11 QH105_11_sh "Type de toilettes: Chasse d'eau connectée à un système d'égout - shared". shared_fac QH105_12 QH105_12_sh "Type de toilettes: Chasse d'eau connectée à une fosse septique - shared". shared_fac QH105_13 QH105_13_sh "Type de toilettes: Chasse d'eau connectée à une fosse d'aisances - shared". shared_fac QH105_14 QH105_14_sh "Type de toilettes: Chasse d'eau connectée à quelque chose d'autre - shared". *hared_fac QH105_15 QH105_15_sh "Type de toilettes: Chasse d'eau connectée à ne sait pas où - shared". shared_fac QH105_21 QH105_21_sh "Type de toilettes: Fosse d'aisances améliorée auto-aérée - shared". shared_fac QH105_22 QH105_22_sh "Type de toilettes: Fosse d'aisances avec dalle - shared". shared_fac QH105_23 QH105_23_sh "Type de toilettes: Fosse d'aisances sans dalle trou ouvert - shared". *hared_fac QH105_31 QH105_31_sh "Type de toilettes: Toilettes à compostage - shared". shared_fac QH105_41 QH105_41_sh "Type de toilettes: Toilettes à compostage/Seau/tinette - shared". shared_fac QH105_51 QH105_51_sh "Type de toilettes: Toilettes/latrines suspendues - shared". shared_fac QH105_96 QH105_96_sh "Type de toilettes: Autre - shared". * Type de cuisinière. *ichotomize (QH109=1) QH109_1 "Type de cuisinière: Cuisinière électrique". dichotomize (QH109=2) QH109_2 "Type de cuisinière: Four solaire". dichotomize (QH109=3) QH109_3 "Type de cuisinière: Cuisinière à gaz propane liquéfié (GPL)/Cuisinière à gaz". dichotomize (QH109=4) QH109_4 "Type de cuisinière: Cuisinière connectée au gaz naturel". dichotomize (QH109=5) QH109_5 "Type de cuisinière: Cuisinière au biogaz". dichotomize (QH109=6) QH109_6 "Type de cuisinière: Cuisinière à combustible liquide". dichotomize (QH109=7) QH109_7 "Type de cuisinière: Cuisinière d'un fabricant à combustible solide". dichotomize (QH109=8) QH109_8 "Type de cuisinière: Cuisinière traditionnelle à combustible solide". dichotomize (QH109=9) QH109_9 "Type de cuisinière: Foyer à trois pierres/foyer ouvert". dichotomize (QH109=95) QH109_95 "Type de cuisinière: Pas de repas/nourriture préparé(e) dans le ménage". dichotomize (QH109=96) QH109_96 "Type de cuisinière: Autre". * Type de combustible. *ichotomize (QH110=1) QH110_1 "Type de combustible: Alcool/éthanol". *ichotomize (QH110=2) QH110_2 "Type de combustible: Essence/diesel". dichotomize (QH110=3) QH110_3 "Type de combustible: Paraffine/pétrole". dichotomize (QH110=4) QH110_4 "Type de combustible: Charbon/lignite". dichotomize (QH110=5) QH110_5 "Type de combustible: Charbon de bois". dichotomize (QH110=6) QH110_6 "Type de combustible: Bois". dichotomize (QH110=7) QH110_7 "Type de combustible: Paille/branchages/herbes". *ichotomize (QH110=8) QH110_8 "Type de combustible: Produits agricoles". dichotomize (QH110=8 | QH110=9) QH110_9 "Type de combustible: Produits agricoles/Bouse d'animal/déchets". *ichotomize (QH110=10) QH110_10 "Type de combustible: Combustibles biomasse transformés (Pellets) ou granulés de bois". *ichotomize (QH110=11) QH110_11 "Type de combustible: Ordures/plastique". *ichotomize (QH110=12) QH110_12 "Type de combustible: Sciure". dichotomize (QH110=1 | QH110=2 | QH110=11 |QH110=96) QH110_96 "Type de combustible: Autre/Alcool/éthanol/Essence/diesel/Ordures/plastique". * Vaches laitières ou taureaux. if (missing(QH113A) | QH112 <> 1) QH113A=0. missing values QH113A (99). compute QH113A_1 = (QH113A >= 1 & QH113A <= 4). compute QH113A_2 = (QH113A >= 5 & QH113A <= 9). compute QH113A_3 = (QH113A >= 10 & QH113A <= 98). variable labels QH113A_1 'Vaches laitières ou taureaux: 1-4' /QH113A_2 'Vaches laitières ou taureaux: 5-9' /QH113A_3 'Vaches laitières ou taureaux: 10+'. * Autre bétail. if (missing(QH113B) | QH112 <> 1) QH113B=0. missing values QH113B (99). compute QH113B_1 = (QH113B >= 1 & QH113B <= 4). compute QH113B_2 = (QH113B >= 5 & QH113B <= 98). *compute QH113B_3 = (QH113B >= 10 & QH113B <= 98). variable labels QH113B_1 'Autre bétail: 1-4' /QH113B_2 'Autre bétail: 5+'. * /QH113B_3 'Autre bétail: 10+'. * Chevaux, ânes ou mulets. if (missing(QH113C) | QH112 <> 1) QH113C=0. missing values QH113C (99). compute QH113C_1 = (QH113C >= 1 & QH113C <= 4). compute QH113C_2 = (QH113C >= 5 & QH113C <= 9). compute QH113C_3 = (QH113C >= 10 & QH113C <= 98). variable labels QH113C_1 'Chevaux, ânes ou mulets: 1-4' /QH113C_2 'Chevaux, ânes ou mulets: 5-9' /QH113C_3 'Chevaux, ânes ou mulets: 10+'. * Chameaux - Camels. if (missing(QH113D) | QH112 <> 1) QH113D=0. missing values QH113D (99). compute QH113D_1 = (QH113D >= 1 & QH113D <= 4). compute QH113D_2 = (QH113D >= 5 & QH113D <= 9). compute QH113D_3 = (QH113D >= 10 & QH113D <= 98). variable labels QH113D_1 'Chameaux - Camels: 1-4' /QH113D_2 'Chameaux - Camels: 5-9' /QH113D_3 'Chameaux - Camels: 10+'. * Chèvres. if (missing(QH113E) | QH112 <> 1) QH113E=0. missing values QH113E (99). compute QH113E_1 = (QH113E >= 1 & QH113E <= 4). compute QH113E_2 = (QH113E >= 5 & QH113E <= 9). compute QH113E_3 = (QH113E >= 10 & QH113E <= 98). variable labels QH113E_1 'Chèvres: 1-4' /QH113E_2 'Chèvres: 5-9' /QH113E_3 'Chèvres: 10+'. * Moutons. if (missing(QH113F) | QH112 <> 1) QH113F=0. missing values QH113F (99). compute QH113F_1 = (QH113F >= 1 & QH113F <= 4). compute QH113F_2 = (QH113F >= 5 & QH113F <= 9). compute QH113F_3 = (QH113F >= 10 & QH113F <= 98). variable labels QH113F_1 'Moutons: 1-4' /QH113F_2 'Moutons: 5-9' /QH113F_3 'Moutons: 10+'. * Poulets, pintades, pigeons. if (missing(QH113G) | QH112 <> 1) QH113G=0. missing values QH113G (99). compute QH113G_1 = (QH113G >= 1 & QH113G <= 9). compute QH113G_2 = (QH113G >= 10 & QH113G <= 29). compute QH113G_3 = (QH113G >= 30 & QH113G <= 98). variable labels QH113G_1 'Poulets, pintades, pigeons: 1-9' /QH113G_2 'Poulets, pintades, pigeons: 10-29' /QH113G_3 'Poulets, pintades, pigeons: 30+'. * Canard,oies. if (missing(QH113H) | QH112 <> 1) QH113H=0. missing values QH113H (99). compute QH113H_1 = (QH113H >= 1 & QH113H <= 4). compute QH113H_2 = (QH113H >= 5 & QH113H <= 9). compute QH113H_3 = (QH113H >= 10 & QH113H <= 98). variable labels QH113H_1 'Canard,oies: 1-4' /QH113H_2 'Canard,oies: 5-9' /QH113H_3 'Canard,oies: 10+'. * Lapins. if (missing(QH113I) | QH112 <> 1) QH113I=0. missing values QH113I (99). compute QH113I_1 = (QH113I >= 1 & QH113I <= 4). compute QH113I_2 = (QH113I >= 5 & QH113I <= 9). *ompute QH113I_3 = (QH113I >= 10 & QH113I <= 98). variable labels QH113I_1 'Lapins: 1-4' /QH113I_2 'Lapins: 5+'. * /QH113I_3 'Lapins: 10+'. * Hectares de terres cultivables. compute landarea = QH115. if (missing(QH115) | QH115 >= 99.8) landarea = 99.9. if (missing(QH114) | QH114 <> 1) landarea=0. missing values landarea (99.9). * L'électricité. no2zero QH116A. * Radio. no2zero QH116B. * Télévision. no2zero QH116C. * Téléphone fixe. no2zero QH116D. * Ordinateur. no2zero QH116E. * Réfrigérateur. no2zero QH116F. * Chaise en matériaux traditionnels. no2zero QH116G. * Armoire/bibliothèque. no2zero QH116H. * Réchaud. no2zero QH116I. * Cuisinière, à gaz ou électrique. no2zero QH116J. * Foyer amélioré. no2zero QH116K. * Climatiseur. no2zero QH116L. * Accès à Internet à la maison. no2zero QH116M. * Panneaux solaires. no2zero QH116N. * Groupe électrogène. no2zero QH116O. * Antenne parabolique. no2zero QH116P. * Pendule/Montre. no2zero QH117A. * Bicyclette. no2zero QH117C. * Motocyclette ou un scooter. no2zero QH117D. * Charrette tirée par un animal. no2zero QH117E. * Voiture ou camionnette. no2zero QH117F. * Bateau à moteur ou pinasse. no2zero QH117G. * Charrues. no2zero QH117H. * Pirogue. no2zero QH117I. * Tracteur. no2zero QH117J. * Motodculteur/tracteur. no2zero QH117K. * Semoir motorisé. no2zero QH117L. * Moto tricycle. no2zero QH117M. * Cyclomoteur/vélomoteur. no2zero QH117N. * Motopompe. no2zero QH117O. * Matériau principal du sol. dichotomize (QH132=11) QH132_11 "Matériau principal du sol: Terre/sable". dichotomize (QH132=12 | QH132=22) QH132_12 "Matériau principal du sol: Bouse/Palmes/bambou". *ichotomize (QH132=21) QH132_21 "Matériau principal du sol: Planches en bois". *ichotomize (QH132=22) QH132_22 "Matériau principal du sol: Palmes/bambou". dichotomize (QH132=31) QH132_31 "Matériau principal du sol: Parquet ou bois ciré". dichotomize (QH132=32) QH132_32 "Matériau principal du sol: Bandes de vinyle/asphalte". dichotomize (QH132=33) QH132_33 "Matériau principal du sol: Carrelage". dichotomize (QH132=34) QH132_34 "Matériau principal du sol: Ciment". dichotomize (QH132=35) QH132_35 "Matériau principal du sol: Moquette". *ichotomize (QH132=96) QH132_96 "Matériau principal du sol: Autre". * Matériau principal du toit. dichotomize (QH133=11) QH133_11 "Matériau principal du toit: Pas de toit". dichotomize (QH133=12) QH133_12 "Matériau principal du toit: Chaume/palmes/feuilles". dichotomize (QH133=13) QH133_13 "Matériau principal du toit: Mottes de terre". dichotomize (QH133=21) QH133_21 "Matériau principal du toit: Natte". dichotomize (QH133=22) QH133_22 "Matériau principal du toit: Palmes/bambou". dichotomize (QH133=23) QH133_23 "Matériau principal du toit: Planches en bois". *ichotomize (QH133=24) QH133_24 "Matériau principal du toit: Carton". dichotomize (QH133=31) QH133_31 "Matériau principal du toit: Tôle". dichotomize (QH133=32) QH133_32 "Matériau principal du toit: Bois". *ichotomize (QH133=33) QH133_33 "Matériau principal du toit: Zinc/fibre de ciment". dichotomize (QH133=34 | QH133=36) QH133_34 "Matériau principal du toit: Tuiles/Shingles". dichotomize (QH133=35) QH133_35 "Matériau principal du toit: Ciment". *ichotomize (QH133=36) QH133_36 "Matériau principal du toit: Shingles". dichotomize (QH133=96) QH133_96 "Matériau principal du toit: Autre". * Matériau principal des murs extérieurs. dichotomize (QH134=11) QH134_11 "Matériau principal des murs extérieurs: Pas de mur". dichotomize (QH134=12) QH134_12 "Matériau principal des murs extérieurs: Bambou/cane/palme/tronc". dichotomize (QH134=13) QH134_13 "Matériau principal des murs extérieurs: Terre". dichotomize (QH134=21) QH134_21 "Matériau principal des murs extérieurs: Bambou avec boue". dichotomize (QH134=22) QH134_22 "Matériau principal des murs extérieurs: Pierres avec boue". dichotomize (QH134=23) QH134_23 "Matériau principal des murs extérieurs: Adobe non recouvert". *ichotomize (QH134=24) QH134_24 "Matériau principal des murs extérieurs: Contreplaqué". *ichotomize (QH134=25) QH134_25 "Matériau principal des murs extérieurs: Carton". dichotomize (QH134=26) QH134_26 "Matériau principal des murs extérieurs: Bois de récupération". dichotomize (QH134=31 | QH134=32) QH134_31 "Matériau principal des murs extérieurs: Ciment/Pierres avec chaux/ciment". *ichotomize (QH134=32) QH134_32 "Matériau principal des murs extérieurs: Pierres avec chaux/ciment". dichotomize (QH134=33) QH134_33 "Matériau principal des murs extérieurs: Briques". dichotomize (QH134=34) QH134_34 "Matériau principal des murs extérieurs: Blocs de ciment". dichotomize (QH134=35) QH134_35 "Matériau principal des murs extérieurs: Adobe recouvert". dichotomize (QH134=36) QH134_36 "Matériau principal des murs extérieurs: Planche en bois/shingles". dichotomize (QH134=24 | QH134=96) QH134_96 "Matériau principal des murs extérieurs: Autre/Contraplaqué". *{Members per sleeping room}. if (hhusual=0) hhusual=hhslept. if (QH111>0) memsleep=trunc(hhusual/QH111). if (QH111=0) memsleep=hhusual. if (missing(QH111) or QH111>=99 or memsleep>=98) memsleep=99. variable labels memsleep 'Number of members per sleeping room'. value labels memsleep 0 'Less than 1 per room'. formats memsleep (f2.0). missing values memsleep (99). * Compute urban and rural variables coded (1/0) for filters later. compute urban=(QHTYPE = 1). compute rural=(QHTYPE = 2). variable labels urban 'Urban' / rural 'Rural'. value labels urban 1 'Urban' / rural 1 'Rural'. formats urban rural (f1.0). execute. * Check on indicator variable creation. frequencies variables=QHTYPE to land. * Toilet facility by shared/not shared. crosstabs /tables=QH105 by QH106. * Land area by units - if there are separate units - need to convert them to one unit. *crosstabs /tables=QH115N by QH115U. * Dropped QH101_41 QH101_61 QH105_15 QH105_31 QH105_15_sh QH105_31_sh QH109_1 QH110_1 QH110_2 QH110_8 QH110_10 QH110_11 QH110_12 QH113B_3 QH113I_3 QH132_21 QH132_22 QH132_96 QH133_24 QH133_33 QH133_36 QH134_24 QH134_25 QH134_32. frequencies variables= QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_42 QH101_51 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_41 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_41_sh QH105_51_sh QH105_96_sh QH109_2 QH109_3 QH109_4 QH109_5 QH109_6 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_3 QH110_4 QH110_5 QH110_6 QH110_7 QH110_9 QH110_96 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117N QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_26 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep QH113A_1 QH113A_2 QH113A_3 QH113B_1 QH113B_2 QH113C_1 QH113C_2 QH113C_3 QH113D_1 QH113D_2 QH113D_3 QH113E_1 QH113E_2 QH113E_3 QH113F_1 QH113F_2 QH113F_3 QH113G_1 QH113G_2 QH113G_3 QH113H_1 QH113H_2 QH113H_3 QH113I_1 QH113I_2 landarea . * Turn off weights before all factor analysis. weight off. * Name the dataset window for the HH data for use later. dataset name assets. save outfile='assets.sav'. *** Test Factor Analysis. filter off. execute. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_42 QH101_51 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_41 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_41_sh QH105_51_sh QH105_96_sh QH109_2 QH109_3 QH109_4 QH109_5 QH109_6 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_3 QH110_4 QH110_5 QH110_6 QH110_7 QH110_9 QH110_96 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117N QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_26 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep QH113A_1 QH113A_2 QH113A_3 QH113B_1 QH113B_2 QH113C_1 QH113C_2 QH113C_3 QH113D_1 QH113D_2 QH113D_3 QH113E_1 QH113E_2 QH113E_3 QH113F_1 QH113F_2 QH113F_3 QH113G_1 QH113G_2 QH113G_3 QH113H_1 QH113H_2 QH113H_3 QH113I_1 QH113I_2 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_42 QH101_51 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_41 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_41_sh QH105_51_sh QH105_96_sh QH109_2 QH109_3 QH109_4 QH109_5 QH109_6 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_3 QH110_4 QH110_5 QH110_6 QH110_7 QH110_9 QH110_96 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117N QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_26 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep QH113A_1 QH113A_2 QH113A_3 QH113B_1 QH113B_2 QH113C_1 QH113C_2 QH113C_3 QH113D_1 QH113D_2 QH113D_3 QH113E_1 QH113E_2 QH113E_3 QH113F_1 QH113F_2 QH113F_3 QH113G_1 QH113G_2 QH113G_3 QH113H_1 QH113H_2 QH113H_3 QH113I_1 QH113I_2 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /method=correlation. *** Common Factor analysis ***. ** Removed area-specific variables **. ** Agricultural animal variables excluded ** Land area excluded ** Any others ?. *** Common Factor Analysis. filter off. execute. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_42 QH101_51 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_41 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_41_sh QH105_51_sh QH105_96_sh QH109_2 QH109_3 QH109_4 QH109_5 QH109_6 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_3 QH110_4 QH110_5 QH110_6 QH110_7 QH110_9 QH110_96 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117N QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_26 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_42 QH101_51 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_41 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_41_sh QH105_51_sh QH105_96_sh QH109_2 QH109_3 QH109_4 QH109_5 QH109_6 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_3 QH110_4 QH110_5 QH110_6 QH110_7 QH110_9 QH110_96 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117N QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_26 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL com) /method=correlation. *** Urban Factor Analysis. filter off. filter by urban. execute. * dropped QH101_42 QH101_51 QH101_81 QH105_51 QH110_3 QH117N QH134_26 QH113B_2 QH11C_2 QH113D_3. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_71 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_41 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_41_sh QH105_51_sh QH105_96_sh QH109_2 QH109_3 QH109_4 QH109_5 QH109_6 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_4 QH110_5 QH110_6 QH110_7 QH110_9 QH110_96 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep QH113A_1 QH113A_2 QH113A_3 QH113B_1 QH113C_1 QH113C_3 QH113D_1 QH113D_2 QH113E_1 QH113E_2 QH113E_3 QH113F_1 QH113F_2 QH113F_3 QH113G_1 QH113G_2 QH113G_3 QH113H_1 QH113H_2 QH113H_3 QH113I_1 QH113I_2 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_71 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_41 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_41_sh QH105_51_sh QH105_96_sh QH109_2 QH109_3 QH109_4 QH109_5 QH109_6 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_4 QH110_5 QH110_6 QH110_7 QH110_9 QH110_96 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep QH113A_1 QH113A_2 QH113A_3 QH113B_1 QH113C_1 QH113C_3 QH113D_1 QH113D_2 QH113E_1 QH113E_2 QH113E_3 QH113F_1 QH113F_2 QH113F_3 QH113G_1 QH113G_2 QH113G_3 QH113H_1 QH113H_2 QH113H_3 QH113I_1 QH113I_2 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL urb) /method=correlation. *** Rural Factor Analysis. filter off. filter by rural. execute. * Dropped QH101_91 QH101_92 QH105_14 QH105_21 QH105_96 QH105_11_sh QH105_41_sh QH109_2 QH109_6 QH110_4 QH110_96. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_42 QH101_51 QH101_71 QH101_81 QH101_96 QH105_11 QH105_12 QH105_13 QH105_22 QH105_23 QH105_41 QH105_51 QH105_61 QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_51_sh QH105_96_sh QH109_3 QH109_4 QH109_5 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_3 QH110_5 QH110_6 QH110_7 QH110_9 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117N QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_26 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep QH113A_1 QH113A_2 QH113A_3 QH113B_1 QH113B_2 QH113C_1 QH113C_2 QH113C_3 QH113D_1 QH113D_2 QH113D_3 QH113E_1 QH113E_2 QH113E_3 QH113F_1 QH113F_2 QH113F_3 QH113G_1 QH113G_2 QH113G_3 QH113H_1 QH113H_2 QH113H_3 QH113I_1 QH113I_2 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_42 QH101_51 QH101_71 QH101_81 QH101_96 QH105_11 QH105_12 QH105_13 QH105_22 QH105_23 QH105_41 QH105_51 QH105_61 QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_51_sh QH105_96_sh QH109_3 QH109_4 QH109_5 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_3 QH110_5 QH110_6 QH110_7 QH110_9 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117N QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_26 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep QH113A_1 QH113A_2 QH113A_3 QH113B_1 QH113B_2 QH113C_1 QH113C_2 QH113C_3 QH113D_1 QH113D_2 QH113D_3 QH113E_1 QH113E_2 QH113E_3 QH113F_1 QH113F_2 QH113F_3 QH113G_1 QH113G_2 QH113G_3 QH113H_1 QH113H_2 QH113H_3 QH113I_1 QH113I_2 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL rur) /method=correlation. * Label the created score variables. rename variables (com1 urb1 rur1=comscore urbscore rurscore). variable labels comscore 'Common wealth score' /urbscore 'Urban wealth score' /rurscore 'Rural wealth score'. * Add a variable used for linking later. filter off. string rowtype_ (A8). compute rowtype_ = 'EST'. * Calculate regressions. ** Area=urban. filter off. filter by urban. execute. * Declare a dataset to be written to in the regression. dataset declare urbancorv. * Run regression of comscore with urbscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter urbscore /outfile=corv(urbancorv). * Activate file of output from regression. dataset activate urbancorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=urbconst urbscore=urbcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = urbancorv /by ROWTYPE_. execute. * Calculate regressions. ** Area=rural. filter off. filter by rural. execute. * Declare a dataset to be written to in the regression. dataset declare ruralcorv. * Run regression of comscore with rurscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter rurscore /outfile=corv(ruralcorv). * Activate file of output from regression. dataset activate ruralcorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=rurconst rurscore=rurcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = ruralcorv /by ROWTYPE_. execute. dataset close urbancorv. dataset close ruralcorv. dataset activate assets. filter off. *** Calculate combined wealth score from Urban and Rural Scores. * Use coefficients from urban and rural regressions above. compute combscor=0. print formats combscor (f11.5). write formats combscor (f11.5). ** Urban. if (urban = 1) combscor=urbconst+urbcoeff*urbscore. ** Rural. if (rural = 1) combscor=rurconst+rurcoeff*rurscore. variable labels combscor 'Combined national wealth score'. execute. compute hhwt = QHWEIGHT/1000000. variable labels hhwt 'HH weights'. formats hhwt (f12.6). weight by hhwt. filter off. execute. frequencies variables=combscor comscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by urban. execute. frequencies variables=combscor urbscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by rural. execute. frequencies variables=combscor rurscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. execute. *Calculate quintiles and scores for data file. compute hhmemwt=QHWEIGHT*hhusual/1000000. variable labels hhmemwt 'HH members weighting for index'. formats hhmemwt (f12.6). weight by hhmemwt. filter off. filter by urban. execute. rank variables=urbscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. filter by rural. execute. rank variables=rurscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. execute. rank variables=combscor (A) /rank /ntiles (5) /print=yes /ties=mean. variable labels ncombsco 'Combined wealth index' /nurbscor 'Urban wealth index' /nrurscor 'Rural wealth index'. value labels ncombsco nurbscor nrurscor 1 'Lowest' 2 'Second' 3 'Middle' 4 'Fourth' 5 'Highest'. *** Check on quintiles. frequencies variables=ncombsco nurbscor nrurscor. weight by hhwt. ctables /table ( QH101_11+QH101_12+QH101_13+QH101_14+QH101_21+QH101_31+QH101_32+QH101_42+QH101_51+QH101_71+QH101_81+QH101_91+QH101_92+QH101_96+ QH105_11+QH105_12+QH105_13+QH105_14+QH105_21+QH105_22+QH105_23+QH105_41+QH105_51+QH105_61+QH105_96+ QH105_11_sh+QH105_12_sh+QH105_13_sh+QH105_14_sh+QH105_21_sh+QH105_22_sh+QH105_23_sh+QH105_41_sh+QH105_51_sh+QH105_96_sh+ QH109_2+QH109_3+QH109_4+QH109_5+QH109_6+QH109_7+QH109_8+QH109_9+QH109_95+QH109_96+ QH110_3+QH110_4+QH110_5+QH110_6+QH110_7+QH110_9+QH110_96+ QH116A+QH116B+QH116C+QH116D+QH116E+QH116F+QH116G+QH116H+QH116I+QH116J+QH116K+QH116L+QH116M+QH116N+QH116O+QH116P+QH117A+QH117C+QH117D+QH117E+QH117F+QH117G+ QH117H+QH117I+QH117J+QH117K+QH117L+QH117M+QH117N+QH117O+MOBPHONE+ QH132_11+QH132_12+QH132_31+QH132_32+QH132_33+QH132_34+QH132_35+ QH133_11+QH133_12+QH133_13+QH133_21+QH133_22+QH133_23+QH133_31+QH133_32+QH133_34+QH133_35+QH133_96+ QH134_11+QH134_12+QH134_13+QH134_21+QH134_22+QH134_23+QH134_26+QH134_31+QH134_33+QH134_34+QH134_35+QH134_36+QH134_96+ LAND+memsleep+ QH113A_1+QH113A_2+QH113A_3+QH113B_1+QH113B_2+ QH113C_1+QH113C_2+QH113C_3+QH113D_1+QH113D_2+QH113D_3+ QH113E_1+QH113E_2+QH113E_3+QH113F_1+QH113F_2+QH113F_3+ QH113G_1+QH113G_2+QH113G_3+QH113H_1+QH113H_2+QH113H_3+ QH113I_1+QH113I_2+landarea )[S][Mean F8.3] by (ncombsco+nurbscor+nrurscor)[C] /slabels visible=no. * Alternative instead of ctables. *means tables= QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_42 QH101_51 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_41 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_41_sh QH105_51_sh QH105_96_sh QH109_2 QH109_3 QH109_4 QH109_5 QH109_6 QH109_7 QH109_8 QH109_9 QH109_95 QH109_96 QH110_3 QH110_4 QH110_5 QH110_6 QH110_7 QH110_8 QH110_9 QH110_96 QH116A QH116B QH116C QH116D QH116E QH116F QH116G QH116H QH116I QH116J QH116K QH116L QH116M QH116N QH116O QH116P QH117A QH117C QH117D QH117E QH117F QH117G QH117H QH117I QH117J QH117K QH117L QH117M QH117N QH117O MOBPHONE QH132_11 QH132_12 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_31 QH133_32 QH133_34 QH133_35 QH133_96 QH134_11 QH134_12 QH134_13 QH134_21 QH134_22 QH134_23 QH134_26 QH134_31 QH134_33 QH134_34 QH134_35 QH134_36 QH134_96 LAND memsleep QH113A_1 QH113A_2 QH113A_3 QH113B_1 QH113B_2 QH113C_1 QH113C_2 QH113C_3 QH113D_1 QH113D_2 QH113D_3 QH113E_1 QH113E_2 QH113E_3 QH113F_1 QH113F_2 QH113F_3 QH113G_1 QH113G_2 QH113G_3 QH113H_1 QH113H_2 QH113H_3 QH113I_1 QH113I_2 landarea by ncombsco nurbscor nrurscor /cells mean count stddev. graph /histogram(normal)=combscor /title= 'Distribution of Households by Wealth Scores'. frequencies variables=combscor /format=notable /ntiles=5 /statistics=stddev minimum maximum semean mean median mode skewness seskew kurtosis sekurt /order=analysis. weight off. filter off. write formats combscor urbscore rurscore (f11.5). * Save final dataset of assets. save outfile='assets.sav'. *** Write out scores file. write outfile='scores.dat' table /QHCLUST QHNUMBER combscor ncombsco urbscore nurbscor rurscore nrurscor. execute. * Produce table 2.6 weighted by de jure population to test. weight by hhmemwt. compute total = 0. variable labels total 'Total'. value labels total 0 ' '. ctables /vlabels variables=QHTYPE QHREGION total Ncombsco display=both /table QHTYPE [C] + QHREGION [C] + total [C] BY Ncombsco [C][rowpct.count '%' F8.1, totals [rowpct.count '%' F8.1, count '' F8.0]] /categories variables=Ncombsco total=yes /titles title='Table 2.6 Wealth Quintiles' '' 'Percent distribution of the de jure population by wealth quintiles, according to residence and region, Niger MIS 2021' corner='Residence/region' /slabels visible=no.